package org.wheel.jpa.id;

import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentifierGenerator;
import org.wheel.base.id.SnowflakeIdGenerator;

/**
 * @author klaus.wang
 */
public class LongIdGenerator implements IdentifierGenerator {

	@Override
	public Long generate(SharedSessionContractImplementor session, Object object) throws HibernateException {
		return SnowflakeIdGenerator.getInstance().nextId();
	}

}
